<template>
    <div>
      <input type="checkbox" >全选
      <button v-for="(item,index) in arr" :key="index" 
      :class="nowIndex==index?'active':''" @click="tab(index)">{{ item }}</button>
      <span @click="delAll">清空已完成的</span>
    </div>
  </template>
  
  <script setup lang="ts">
  import { ref, computed } from 'vue';
  let nowIndex=ref(0)
  const data=defineProps(['list'])
  const emits=defineEmits(['delAll'])
  let tab=(index:number)=>{
    nowIndex.value=index
  }
  let delAll=()=>{
    emits('delAll')
  }
  let arr=ref(['全部','已完成','未完成'])
  </script>
  
  <style >
  
  </style>
  